package huanzhao.erp.domain.types;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.Getter;

/**
 * @author April
 * 2024/6/22 上午11:06
 * @version 1.0
 */
@Getter
public enum NotificationType {
    TASK_TIMEOUT("接收手机超时"),
    NEW_PHONE("新增手机"),
    NEW_TASK("新任务"),
    NEW_EXCEPTION("新异常事件"),
    PHONE_TIMEOUT("手机超时未签收"),
    EXCEPTION_REPLY("异常事件批复"),
    FINANCE_SETTLE("财务结算"),
    TASK_ACTIVATE("任务唤醒"),
    TASK_REJECT("拒绝接收任务");

    @EnumValue
    @JsonValue
    private final String value;

    NotificationType(String value) {
        this.value = value;
    }

    public static NotificationType convert(String value) {
        for (NotificationType type : NotificationType.values()) {
            if (type.value.equals(value)) {
                return type;
            }
        }
        return null;
    }
}
